﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "UniIdentity.h"
#include "GnufExtension.h"
#include "GnufIParameterDisplayCustom.h"
namespace gcmp
{
    class IElement;
}

namespace gnuf
{
    class IParameterDisplayCustom;
    class GNUF_EXTENSION_EXPORT ParameterDisplayCustomFactory
    {
    public:
        virtual ~ParameterDisplayCustomFactory();

        static ParameterDisplayCustomFactory* Get();

        bool Register(const gcmp::UniIdentity& paramUid, gcmp::OwnerPtr<IParameterDisplayCustom> opDisplayCustom);
        bool UnRegister(const gcmp::UniIdentity& paramUrid);
        IParameterDisplayCustom* Find(const gcmp::UniIdentity& paramUid);

    private:
        ParameterDisplayCustomFactory() {};
        ParameterDisplayCustomFactory(const ParameterDisplayCustomFactory&);
        ParameterDisplayCustomFactory& operator=(const ParameterDisplayCustomFactory&);

        std::map<gcmp::UniIdentity, gcmp::OwnerPtr<IParameterDisplayCustom>> m_paramterUidToCustoms;
    };

    class GNUF_EXTENSION_EXPORT ParameterDisplayCustomCreator
    {
    public:
        ParameterDisplayCustomCreator(const gcmp::UniIdentity& paramUid, gcmp::OwnerPtr<IParameterDisplayCustom> opDisplayCustom);

    };
}
